set RECV_LISTEN(353) m_353
set RECV_LISTEN(366) m_366

proc m_353 {chid raw parent me} {
	global CHANS_$chid
	global CHAN
	global NAMESLOCK
	global NS
	
	regexp {:[^ ]+ 353 [^ ]+ [^ ]+ ([^ ]+) :(.+)} $raw -> channel nicklist
	set num [set "CHANS_$chid\([string tolower $channel]\)"]
	
	if {$NAMESLOCK != 1} {
		set users _users
		$parent.chan$num.users delete 0 end
	}
	
	
	set CHAN $channel
	set NS [concat $NS $nicklist]
}

proc m_366 {chid raw parent me} {
	global CHANS_$chid
	global CHAN
	global NAMESLOCK
	global NS
	
	set channel $CHAN
	set num [set "CHANS_$chid\([string tolower $channel]\)"]
	parsenicklist $parent.chan$num.users [lsort $NS]
	set NAMESLOCK 0;
	set NS {}
}
